/*
 * @Description: 上传相关
 */
import globalMethods from '@/plugins/methods';

export default ({ service, request, tools }) => ({
    /**
     * @description: 上传附件
     */
    uploadFileUpload(data, config) {
        return request({
            url: `${globalMethods.getLocationOrigin()}/seeyon/fileUpload.do?method=processUploadForH5`,
            method: 'post',
            data,
            ...config,
        });
    },
    /**
     * @description: 获取文件状态
     */
    uploadGetFileState(data, config) {
        return request({
            url: `${globalMethods.getLocationOrigin()}/seeyon/ajax.do`,
            method: 'post',
            params: {
                method: 'ajaxAction',
                managerName: 'fileManager',
                rnd: Math.random(),
            },
            data,
            ...config,
        });
    },
});
